<script setup lang="ts">

let baseUrl = 'http://192.168.5.120:8090'
// 接收父组件传过来的数据
const props = defineProps({
        articleInfo: {
            type: Object
        }
    }
)
// console.log(props.articleInfo)
</script>

<template>
    <div>

        <div class="articleList">

            <div class="each" >
<!--                <router-link to="/textDetail" style="color: black">-->
                    <div class="content">
                        <p>{{props.articleInfo.title}}</p>
                        <div class="span">
                            <span>{{props.articleInfo.readers}}人已读</span>
                            <span>{{props.articleInfo.sendTime}}</span>
                        </div>
                    </div>
                    <div class="pic">
                        <img :src="baseUrl+props.articleInfo.titlePicture"
                             alt="文章封面">
                    </div>
<!--                </router-link>-->
            </div>

        </div>
    </div>
</template>

<style scoped lang="less">
.van-cell-group {
  margin: 0;
}

.articleList {
  //height: 50vh;
  margin: 0 auto;
  width: 95%;
  //background-color: #39a9ed;
  a {
    display: flex;
    padding: 5px 2px;
    flex-wrap: wrap;
    align-content: space-between;
  }

  .each {
      border-radius: 10px;
    padding: 8px 3px;
    width: 100%;
    height: 13vh;
    margin-bottom: 10px;
    background-color: white;
    display: flex;
    justify-content: space-between;

    .content {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      width: 70%;

      p {
        margin-top: 0;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
      }

      .span {
        color: grey;
        display: flex;
        justify-content: space-between;
      }
    }

    .pic {
        margin-left: 8px;
      height: 10vh;
      width: 26%;

      img {
        width: 100%;
        height: 100%;
      }
    }
  }
}
</style>